FROM node:12.16.1
WORKDIR /vue-element-admin/
COPY . .
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
RUN cnpm install || npm install
RUN npm run build:prod

FROM nginx:alpine
LABEL MAINTAINER="1194979849@qq.com"

COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=0 /vue-element-admin/dist/ /usr/share/nginx/html
RUN cat /etc/nginx/nginx.conf
RUN cat /etc/nginx/conf.d/default.conf
RUN ls -al /usr/share/nginx/html
